import  { AppPostT } from '@/utils/request'
import { ComputeTaskOverview, ComputeTaskPageSearch, ComputeTaskPageResult } from '@/models/computeTask'

// 获取计算作业概览
export async function getComputeTaskOverview() {
    const data = {}
    const res = await AppPostT<ComputeTaskOverview>("/computeTask/overview", data)
    console.log("getComputeTaskOverview request:", data, ", result:", res)
    return res.data ? res.data : {} as ComputeTaskOverview
}

// 获取计算作业列表
export async function getComputeTask(data: ComputeTaskPageSearch) {
    const res = await AppPostT<ComputeTaskPageResult>("/computeTask/myList", data)
    console.log("getComputeTask request:", data, ", result:", res)
    return res.data ? res.data : {} as ComputeTaskPageResult
}

// 获取我的当前计算作业
// 前端分页，此曙光接口不支持分页查询，会一次把数据给出来，如需要分页，由前端处理
export async function getMyCurrentList() {
    const data = {}
    const res = await AppPostT<ComputeTaskPageResult>("/computeTask/myCurrentList", data)
    console.log("getMyCurrentList request:", data, ", result:", res)
    return res.data ? res.data : {} as ComputeTaskPageResult
}
